﻿@model HouseHoldBudget.Models.Budgets.BudgetResultModel
@using (Html.BeginForm())
{
           <div>
            <table class="content">
                <tr>
                    <td class="adminTitle">
                        @Html.LabelFor(model => model.BudgetName):
                    </td>
                    <td class="adminData">
                        @Html.DisplayFor(model => model.BudgetName)
                    </td>
                </tr>
                <tr>
                    <td class="adminTitle">
                        @Html.LabelFor(model => model.BudgetOwner.UserFullName):
                    </td>
                    <td class="adminData">
                        @Html.DisplayFor(model => model.BudgetOwner.UserFullName)
                    </td>
                </tr>
                <tr>
                    <td class="adminTitle">
                        @Html.LabelFor(model => model.MonthPeriodItems):
                    </td>
                    <td class="adminData">
                        @if (Model.MonthPeriodEnabled)
                        {
                            @Html.DropDownListFor(model => model.MonthPeriod, Model.MonthPeriodItems)
                        }
                        @Html.DropDownListFor(model => model.AnnualPeriod, Model.AnnualPeriodItems)
                        <input type="submit" class="t-button" type="submit" value="Afficher" name="show-budget-period" />
                    </td>
                </tr>
            </table>
        </div>
        <br />
        <div>
            <table class="content">
                <tr>
                    <td class="adminTitle">
                        @Html.LabelFor(model => model.TotalIncomes):
                    </td>
                    <td class="adminData">
                        @Html.DisplayFor(model => model.TotalIncomes)
                    </td>
                </tr>
                <tr>
                    <td class="adminTitle">
                        @Html.LabelFor(model => model.TotalExpenses):
                    </td>
                    <td class="adminData">
                        @Html.DisplayFor(model => model.TotalExpenses)
                    </td>
                </tr>
                <tr>
                    <td class="adminTitle">
                        @Html.LabelFor(model => model.TotalOutstanding):
                    </td>
                    <td class="adminData">
                        @Html.DisplayFor(model => model.TotalOutstanding)
                    </td>
                </tr>
            </table>
        </div>
        <br />
        <table class="content">
            <tr>
                <td class="adminCategoryTitle" colspan="1">
                    Synthèse des dépenses
                </td>
            </tr>
            <tr>
                <td class="adminTitle">
                    @Html.DisplayFor(model => model.BudgetOwner.UserFullName):
                </td>
                <td class="adminData">
                    @Html.DisplayFor(model => model.BudgetOwner.TotalExpenseAmount)
                </td>
            </tr>
            @foreach (var actor in Model.BudgetActors)
            {
                <tr>
                    <td class="adminTitle">
                        @actor.UserFullName:
                    </td>
                    <td class="adminData">
                        @actor.TotalExpenseAmount.ToString("C")
                    </td>
                </tr>
            }
        </table>
        <br />
        <table class="content">
            <tr>
                <td class="adminCategoryTitle" colspan="1">
                    Synthèse des revenus
                </td>
            </tr>
            <tr>
                <td class="adminTitle">
                    @Html.DisplayFor(model => model.BudgetOwner.UserFullName):
                </td>
                <td class="adminData">
                    @Html.DisplayFor(model => model.BudgetOwner.TotalIncomesAmount)
                </td>
            </tr>
            @foreach (var actor in Model.BudgetActors)
            {
                <tr>
                    <td class="adminTitle">
                        @actor.UserFullName:
                    </td>
                    <td class="adminData">
                        @actor.TotalIncomesAmount.ToString("C")
                    </td>
                </tr>
            }
        </table>
}
